-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Alerts] Uses aggregations in RulesClient.aggregate() method #119852
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Thank you for making this update! Just a comment about appropriately auditing authorization errors and a suggestion about null checking.
💚 Build Succeeded
Metrics [docs]Public APIs missing comments
Async chunks
History
To update your PR or re-run it, just comment with: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Verified the Rule Management page that currently uses this API still works as expected and that the aggregations only aggregate over rules the user has access to. Nice job
Thank you for advice and review feedback @ymao1! Looking forward to collaborating more on alerting framework and APIs 🚀 |
…#119852) * Replaces multiple find requests with aggregations * Updates unit tests * Removes commented out code * Removes unused import * Adds muted and enabled aggregations * Updates tests * Updates snapshot * Fixes functional test * Fixes functional test * Review feedback, fixes API tests * Logs audit event and updates tests
💚 Backport successful
This backport PR will be merged automatically after passing CI. |
#120166) * Replaces multiple find requests with aggregations * Updates unit tests * Removes commented out code * Removes unused import * Adds muted and enabled aggregations * Updates tests * Updates snapshot * Fixes functional test * Fixes functional test * Review feedback, fixes API tests * Logs audit event and updates tests Co-authored-by: Claudio Procida <[email protected]>
…#119852) * Replaces multiple find requests with aggregations * Updates unit tests * Removes commented out code * Removes unused import * Adds muted and enabled aggregations * Updates tests * Updates snapshot * Fixes functional test * Fixes functional test * Review feedback, fixes API tests * Logs audit event and updates tests
Summary
This PR ships a performance improvement of the
RulesClient.aggregate()
method to use aggregations instead of multiplefind()
queries.This seems viable as #64002 has already been merged. Thanks to @ymao1 for advice on the aggregation fields to use!
kibana/x-pack/plugins/alerting/server/rules_client/rules_client.ts
Lines 646 to 651 in 324c587
Checklist